package com.cdm.beans.user;

import net.sf.frails.JSFHelper;
import net.sf.frails.bean.annotations.DefMbean;
import net.sf.frails.bean.annotations.PreRender;
import net.sf.frails.bean.annotations.Prop;
import net.sf.frails.bean.annotations.ScopeType;

import com.cdm.persistence.User;
import com.cdm.util.Constants;
import com.vivo.util.DTool;

@DefMbean
public class UserHomeBean {

	@Prop
	User loginUser;

	@PreRender(failOutcome = "/user/home")
	public boolean init() {
		Object object = JSFHelper.getFromApplication(Constants.LOGIN_USER_KEY);
		if (object instanceof User && object != null) {
			loginUser = (User) object;
		}

		DTool.d.debug("Enter User Home Page");
		return true;
	}

}
